//
//  PersonHeadView.m
//  ZHZtest
//
//  Created by 李彦宏 on 2017/12/15.
//  Copyright © 2017年 LYH. All rights reserved.
//

#import "PersonHeadView.h"

@interface PersonHeadView()<UIGestureRecognizerDelegate>
@end
@implementation PersonHeadView

-(void)awakeFromNib{
    [super awakeFromNib];
    self.txImg.userInteractionEnabled = YES;
    UITapGestureRecognizer * PrivateLetterTap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapGesture:)];
    PrivateLetterTap.numberOfTouchesRequired = 1; //手指数
    PrivateLetterTap.numberOfTapsRequired = 1; //tap次数
    PrivateLetterTap.delegate= self;
    self.txImg.contentMode = UIViewContentModeScaleToFill;
    [self.txImg addGestureRecognizer:PrivateLetterTap];
}

-(void)tapGesture:(UITapGestureRecognizer *)sender{
    
    if (_delegate) {
        if ([_delegate respondsToSelector:@selector(changeImage:)]) {
            [_delegate changeImage:sender];
        }
    }
}
@end
